package homework.exp03;

import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.Scanner;

public class C {
    static Scanner cin = null;

    static {
        try {
            cin = new Scanner(new FileReader(new File("C.in")));
        } catch (IOException e) {
            cin = new Scanner(System.in);
        }
    }

    final static long MOD = 1000000007L;

    public static void main(String[] args) {

        int n = cin.nextInt();
        long[] f = new long[10000 + 1];
        f[0] = f[1] = f[2] = 1;
        f[3] = 2;
        for (int i = 4; i <= n; i++) {
            f[i] = (f[i - 1] + f[i - 3]) % (MOD);
        }
        System.out.println(f[n]);
    }
}